<template>
    <div>
        <div id="slider" class="mui-slider">
            <div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
                <div class="mui-scroll">
                    <a :class="['mui-control-item',item.id==1?'mui-active':'']" v-for="item in user" :key="item.id">
                        {{item.name}}
                    </a>
                </div>
            </div>
		</div>
    </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {
  data() {
      return {
          user:[]
      }
  },
  mounted() {
    mui(".mui-scroll-wrapper").scroll({
      deceleration: 0.0005 //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
    });
  },
  created:function(){
        this.getNewsInfo()
    },
    methods:{
        getNewsInfo(){
            this.$http.get('users').then(result=>{
                if(result.status===200){
                    this.user=result.body
                }else{
                    Toast('获取新闻失败')
                }
            })
        }
    },
};
</script>
<style>
</style>
